package common

// RTPS协议常量定义
const (
	// RTPS协议版本
	ProtocolVersionMajor = 2
	ProtocolVersionMinor = 2

	// Vendor ID
	VendorIDUnknown = 0x0000

	// 默认端口
	DefaultPortSPDP = 7400
	DefaultPortSEDP = 7410
	DefaultPortUser = 7410

	// 多播地址
	MulticastAddressSPDP = "239.255.0.1"
	MulticastAddressSEDP = "239.255.0.2"

	// 消息类型
	MessageTypeInfoTS          = 0x01
	MessageTypeInfoDestination = 0x06
	MessageTypeData            = 0x15
	MessageTypeGap             = 0x08
	MessageTypeHeartbeat       = 0x07
	MessageTypeAckNack         = 0x06
	MessageTypeInfoReply       = 0x09
	MessageTypeInfoReplyIP4    = 0x0A

	// QoS策略
	QoSPolicyReliabilityReliable   = 0x01
	QoSPolicyReliabilityBestEffort = 0x02
)

// GUID结构定义
type GUID struct {
	Prefix   [12]byte
	EntityID [4]byte
}

// Locator结构定义
type Locator struct {
	Kind    uint32
	Port    uint32
	Address [16]byte
}
